Repository navigation
fix(analytics): drop chunk-load errors from PostHog error tracking - #556
Merged
Merged
Conversation
After a deploy, a stale tab's programmatic router.push() to a lazy route fails to load the removed chunk. chunkReload handles it (reload or message), but vue-router still rejects the push and posthog-js reports the rejection as unhandled. - add dropChunkLoadErrors before_send: drops $exception events whose entries are all chunk-load errors (reuses isChunkLoadError) - before_send is now [maskUrlCodes, dropChunkLoadErrors] - tests for dropped, kept (other, mixed) and non-exception events - docs/analytics.md notes the filter Closes #554 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
✅ Deploy Preview for prunplanner-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
| Duplication | 0 |
🟢 Coverage ∅ diff coverage · +0.00% coverage variation
Metric Results Coverage variation ✅ +0.00% coverage variation (-1.00%) Diff coverage ✅ ∅ diff coverage Coverage variation details
Coverable lines Covered lines Coverage Common ancestor commit (2dd075e) 3714 3624 97.58% Head commit (5decdae) 3714 (+0) 3624 (+0) 97.58% (+0.00%) Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch:
<coverage of head commit> - <coverage of common ancestor commit>Diff coverage details
Coverable lines Covered lines Diff coverage Pull request (#556) 0 0 ∅ (not applicable) Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified:
<covered lines added or modified>/<coverable lines added or modified> * 100%
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
After a deploy, a tab still on the old bundle fails to load a removed lazy chunk when it navigates programmatically (e.g.
router.push("/")on session end or logout).chunkReloadalready handles the failure viarouter.onError(reload, or the "page load failed" message), but vue-router still rejects thepush()promise, and posthog-js reports that rejection as an unhandled exception, adding noise after every deploy. posthog-js wrapswindow.onunhandledrejectiondirectly and ignoresdefaultPrevented, so the filter lives inbefore_send.Closes #554
Changes
dropChunkLoadErrorsbefore_send: drops$exceptionevents whose entries are all chunk-load errors (reusesisChunkLoadErrorfromchunkReload)before_sendis now[maskUrlCodes, dropChunkLoadErrors]docs/analytics.mdnotes the filterTrade-off: a chunk that stays broken after
chunkReload's reload guard is no longer reported to PostHog either (the user still sees the message), same as navigations viaRouterLinkalready behaved.How it was verified
pnpm test && pnpm test:components && pnpm tsc && pnpm lint && pnpm knipandpnpm buildpass.$exception_list[].valueand thatbefore_sendarrays run in order withnullshort-circuiting.HomepageViewchunk-load samples (beyond tabs still on the pre-fix bundle).🤖 Generated with Claude Code